﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SiteItem.aspx.cs" Inherits="Manage_Cms_SiteItem" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <!--#include file="../js/html_head.inc"-->
    <link rel="stylesheet" href="../Themes/<%=ManageHelper.GetTheme()%>/style.css" type="text/css" />
    <script type="text/javascript">
    $$=function(ID){return document.getElementById(ID)}
    function showServerDomain(serverID)
    {
        location.href='SiteItem.aspx?serID='+serverID;
    }

    
    function showSiteUrl(SiteKey)
    {
         $.ajax({
            type:"POST",
            async:false,
            url:"SiteItem.aspx",
            data:"act=showsiteurl&SiteKey="+SiteKey+"&serID=<%=serverID %>",
            success:function(msg){
                $$("SiteUrl_DIV").innerHTML = msg;
            }
        });
    }
    
    function pLoad()
    {
        if(<%=modelCmsSite.ServerID %>==-1)
        {
            var frm = $$("form1");
            var inputs =frm.getElementsByTagName("input");
            for(var i=0;i<inputs.length-3;i++)
            {
                inputs[i].disabled="disabled";
                inputs[i].style.background="#E6E4E1";
            }
        }
    }
    </script>
</head>
<body onload="pLoad()">
    <%=ManageHelper.PageSucMsg()!=""?"<div class='msg_succeed'>"+ManageHelper.PageSucMsg()+"</div>":""%>
    <form id="form1" action="?act=<%=ActFlag %>" method="post" onsubmit="return validator(this)">
    <div class="mycolumn">
        <div class="columntitle">
            <%=ActName %>
            站点</div>
        <table width="95%" align="center" cellpadding="6" cellspacing="3">
            <tr>
                <td align="left" width="90">
                    <img src="../pic/icons/help.gif" alt="服务器" onclick="helpInf(this)" />
                    服务器：
                </td>
                <td align="left" class="tdselect">
                    <select name="ServerID" onchange="showServerDomain(this.value)" style="border: 1px solid red;
                        width: 162px;" valid="required" errmsg="请选择服务器。">
                        <%=KeRui.BLL.Common.GetSelectList(modelCmsSite.ServerID, bllCmsSite.GetSel())%>
                    </select>
                    <input type="hidden" name="hiddendoMain" id="hiddendoMain" value="<%=modelCmsSever.Domain %>" />
                </td>
            </tr>
            <tr>
                <td align="left">
                    <img src="../pic/icons/help.gif" alt="唯一标识此站点名称的字符串" onclick="helpInf(this)" />
                    站点名称：
                </td>
                <td align="left">
                    <input name="SiteName" type="text" value="<%=modelCmsSite.SiteName %>" valid="required"
                        errmsg="请输入站点名称。" />
                </td>
            </tr>
            <tr>
                <td align="left">
                    <img src="../pic/icons/help.gif" alt="站点标识符，二级域名" onclick="helpInf(this)" />
                    站点标识符：
                </td>
                <td align="left">
                    <input name="SiteKey" id="SiteKey" type="text" onkeyup="showSiteUrl(this.value)"
                        value="<%=modelCmsSite.SiteKey %>" />
                </td>
            </tr>
            <tr>
                <td align="left">
                    <img src="../pic/icons/help.gif" alt="站点网站" onclick="helpInf(this)" />
                    站点网站：
                </td>
                <td align="left" class="tdradio">
                    <!--<input name="SiteUrl" id="SiteUrl" type="text"  value="<%=modelCmsSite.SiteUrl==""||modelCmsSite.SiteKey==null?"http://"+modelCmsSever.Domain:modelCmsSite.SiteUrl %>"
                            valid="required" errmsg="请输入站点网站。" style="border:0;border-bottom:1px solid red;" disabled />-->
                    <div id="SiteUrl_DIV">
                    </div>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <img src="../pic/icons/help.gif" alt="站点路径。创建后不能修改。" onclick="helpInf(this)" />
                    站点路径：
                </td>
                <td align="left">
                    <%=modelCmsSite.SiteDir == null ? "<input name=\"SiteDir\" type=\"text\"  value='D:\\iPortal\\KeRui.Site' valid=\"required\" errmsg=\"请输入站点路径。\"/>" : modelCmsSite.SiteDir%>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <img src="../pic/icons/help.gif" alt="默认模板" onclick="helpInf(this)" />
                    默认模板：
                </td>
                <td align="left" class="tdselect">
                    <select name="TemplateID" valid="required" errmsg="请选择默认模板。">
                        <%=KeRui.BLL.Common.GetSelectList(modelCmsSite.TemplateID, bllCmsTemplate.GetSelect(modelCmsSite.ServerID))%>
                    </select>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <img src="../pic/icons/help.gif" alt="是否使用" onclick="helpInf(this)" />
                    是否使用：
                </td>
                <td align="left" class="tdradio">
                    <input type="radio" name="IsUsing" value="1" <%=modelCmsSite.IsUsing==1?"checked":"" %> />
                    是
                    <input type="radio" name="IsUsing" value="0" <%=modelCmsSite.IsUsing==0?"checked":"" %> />
                    否
                </td>
            </tr>
            <tr>
                <td align="left">
                    <img src="../pic/icons/help.gif" alt="排序" onclick="helpInf(this)" />
                    排序：
                </td>
                <td align="left">
                    <input name="OrderID" type="text" value="<%=modelCmsSite.OrderID==0?bllCmsSite.GetMaxOrderID():modelCmsSite.OrderID %>"
                        valid="required|isInt" errmsg="排序不能为空。|排序应为一个整数。" />
                </td>
            </tr>
            <tr>
                <td colspan="2" class="tdbutton" align="center">
                    <input type="submit" name="sub" value=" <%=ActName %> " />
                    <input type="hidden" name="SiteID" value="<%=modelCmsSite.SiteID %>" />
                    <input type="button" value="取 消" onclick="window.parent.ymPrompt.doHandler('close');" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
<!--<%=modelCmsSite.OrderID %>-->
</html>
